package org.jeecg.modules.hc.enums;

import com.fasterxml.jackson.annotation.JsonValue;
import lombok.Getter;

import java.util.Arrays;
import java.util.Optional;

@Getter
public enum HcSyncMerchantSettlementTypeEnum {
    TODAY("今天"),
    YESTERDAY("昨天"),
    ALL("全部"),
    ;


    @JsonValue
    private final String name;

    HcSyncMerchantSettlementTypeEnum(String name) {
        this.name = name;
    }

    public static HcSyncMerchantSettlementTypeEnum getByName(String name) {
        Optional<HcSyncMerchantSettlementTypeEnum> first = Arrays.stream(HcSyncMerchantSettlementTypeEnum.values()).filter(e -> e.getName().equals(name)).findFirst();
        return first.orElse(null);
    }
}
